package Easy;

import java.util.HashMap;

public class Solution1 {
    // 1.两数之和
    public int[] twoSum(int[] nums, int target) {
        int ret[] = new int[2];
        boolean flag = true;
        if (nums.length < 16) {
            // 直接遍历
            for (int i = 0; i < nums.length && flag; i++) {
                for (int j = i + 1; j < nums.length; j++) {
                    if (nums[i] + nums[j] == target) {
                        ret[0] = i;
                        ret[1] = j;
                        flag = false;
                        break;
                    }
                }
            }
        } else {
            // 二分法遍历
        }
        

        return ret;
    }

}
